#include <string>
#include <iostream>
#include "dll.hpp"
#include "common/Win32Utils.hpp"

static int StripNum(std::string name)
{
    std::string ret = "";
    for (size_t i = 0; i < name.size(); i++)
    {
        /* code */
        if(isdigit(name[i]))
        {
            ret.push_back(name[i]);
        }
        if(name[i] == '.')
            break;
    }
    if(ret.empty()) return 0;
    return std::stoi(ret);
}

void GetICD(ICD icd)
{
    auto mName = vrts::Win32Utils::GetSelfModuleName();
    int idx = StripNum(mName);
    if(idx >= 10) idx = 0;

    std::cout << "this is " << mName << std::endl;
    std::cout << "icd.iData = " << icd.iData[idx]<<std::endl;
    std::cout << std::endl;
}